home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / wnos / wn941101 / session.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-11  |  2.9 KB  |  116 lines

  1. #ifndef _SESSION_H
  2. #define _SESSION_H
  3.  
  4. #if !defined(__STDIO_DEF_) && !defined(__STDIO_H)
  5. #  include <stdio.h>
  6. #endif
  7.  
  8. #ifndef _GLOBAL_H
  9. #include "global.h"
  10. #endif
  11.  
  12. #ifndef _CONFIG_H
  13. #include "config.h"
  14. #endif
  15.  
  16. #ifndef _HARDWARE_H
  17. #include "hardware.h"
  18. #endif
  19.  
  20.  
  21. #ifndef _FTPCLI_H
  22. #include "ftpcli.h"
  23. #endif
  24.  
  25. #ifndef _TELNET_H
  26. #include "telnet.h"
  27. #endif
  28.  
  29. #ifndef _ICMP_H
  30. #include "icmp.h"
  31. #endif
  32.  
  33. #ifndef _AX25_H
  34. #include "ax25.h"
  35. #endif
  36.  
  37. #ifndef _PROC_H
  38. #include "proc.h"
  39. #endif
  40.  
  41. #ifndef _TTY_H
  42. #include "tty.h"
  43. #endif
  44.  
  45. /* Session control structure; only one entry is used at a time */
  46. typedef enum  {
  47.    FREE        = 0, TELNET   = 1, FTP      = 2, AX25TNC  = 3,
  48.    FINGER      = 4, PING     = 5, NRSESSION= 6, COMMAND  =7,
  49.    MORE        = 8, HOP      = 9, TIP      =10, PPPPASS  =11,
  50.    TRACESESSION=12, RAW      =13, HYPER    =14, RLOGIN   =15
  51. }Stype;
  52.  
  53. typedef enum {
  54.  Raw, Cooked
  55. } Fmode;
  56.  
  57. /* Session control structure; only one entry is used at a time */
  58. struct session {
  59.     Stype type;
  60.     char *name;                /* Name of remote host */
  61.     union {
  62.         struct ftpcli *ftp;
  63.         struct telnet *telnet;
  64.     } cb;
  65.     struct proc *proc;        /* Primary session process (e.g., tn recv) */
  66.     struct proc *proc1;        /* Secondary session process (e.g., tn xmit) */
  67.     struct proc *proc2;        /* Tertiary session process (e.g., upload) */
  68.     int s;                    /* Primary network socket (control for FTP) */
  69.     FILE *record;            /* Receive record file */
  70.     char *rfile;            /* Record file name */
  71.     FILE *upload;            /* Send file */
  72.     char *ufile;            /* Upload file name */
  73.     struct ttystate ttystate;
  74.     struct screen *screen;
  75.     int input;                /* Input socket */
  76.     int output;                /* Output socket */
  77.     Fmode flowmode;            /* control "more" mode */
  78.     int row;                /* Rows remaining until "more" */
  79.     int morewait;            /* Output driver is waiting on us */
  80. #define PPROMPT    1
  81.     int flag;
  82.     int swap;
  83. #define MAXCS        10        /* cmd line buffer */
  84.     char Cs[MAXCS][162];
  85.     int cont;
  86.     int tsavex;                /* used for split-screen option */
  87.     int tsavey;
  88.     int bsavex;
  89.     int bsavey;
  90.     int split;
  91.     int lwrap;                /* linewrap col */
  92. };
  93. #define    NULLSESSION    (struct session *)0
  94.  
  95. extern char *Sestypes[];
  96. extern unsigned Nsessions;            /* Maximum number of sessions */
  97. extern struct session *Sessions;    /* Session descriptors themselves */
  98. extern struct session *Current;        /* Always points to current session */
  99. extern struct session *Lastcurr;    /* Last non-command session */
  100. extern struct session *Command;        /* Pointer to command session */
  101. extern struct session *Trace;        /* Pointer to trace screen DK5DC */
  102.  
  103. /* In session.c: */
  104. void     freesession __ARGS((struct session *sp));
  105. struct     session *sessptr __ARGS((char *cp));
  106. struct     session *newsession __ARGS((char *name,int type,int split,int swap));
  107. void     upload __ARGS((int unused,void *sp1,void *p));
  108.  
  109. /* In pc.c: */
  110. void     swapscreen __ARGS((struct session *old,struct session *new));
  111.  
  112. extern int16 Lport;
  113. #define    ALERT_EOF    1
  114.  
  115. #endif    /* _SESSION_H */
  116.